﻿namespace Chain.Wechat
{
    using System;
    using System.Collections.Generic;

    public class LogManager
    {
        private static Dictionary<string, ILog> Message = new Dictionary<string, ILog>();

        public static void Add(string key, ILog obj)
        {
            Remove(key);
            Message.Add(key, obj);
        }

        public static bool ContainsKey(string key)
        {
            return Message.ContainsKey(key);
        }

        public static ILog Get(string key)
        {
            if (Message.ContainsKey(key))
            {
                return Message[key];
            }
            return null;
        }

        public static void Remove(string key)
        {
            if (Message.ContainsKey(key))
            {
                Message.Remove(key);
            }
        }
    }
}

